#define _navTop()
<div class="top-nav-pos">
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header">
      <div class="layui-logo" style="width:120px;">#(dp.getSiteName())</div>
      <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="/">首页<span class="layui-badge-dot" style="margin-left:0px;margin-top: -12px;"></span></a>
      </li>
      <li class="layui-nav-item layui-hide-xs">
        <a href="/article/recent">最近文章<span id="recent_count" class="layui-badge" style="margin-left:0px;margin-top:-22px;display:none;">99+</span>
        </a>
      </li>
      <li class="layui-nav-item layui-hide-xs">
        <a href="/diary">时间线<span id="hot_count" class="layui-badge" style="margin-left:0px;margin-top:-22px;display:none;">99+</span></a>
      </li>
      <li class="layui-nav-item">
        <a>文章分类</a>
        <dl class="layui-nav-child" id="catelog0">
          <dd><a><center><i style="font-weight: bold;font-size: 20px;" class="layui-icon layui-anim layui-anim-rotate layui-anim-loop">&#xe63d;</i></center></a></dd>
        </dl>
      </li>
      </ul>
    </div>
  </div>
</div>
<div style="height:60px;"></div>
<script>
layui.use('element', function(){
  var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
  //监听导航点击
  element.on('nav(menu)', function(elem){
    console.log(elem);
    console.log(elem.children(0).innerHTML);
  });
});
$(function(){
  // 获取最近文章数量
  $.get('/article/count', function(ret) {
    if (ret.countR > 0) {
      $('#recent_count').show();
      if (ret.countR > 99) { $('#recent_count').html('99+'); }
      else { $('#recent_count').html(ret.countR); }
    } else { $('#recent_count').hide(); }
    if (ret.countH > 0) {
      $('#hot_count').show();
      if (ret.countH > 99) { $('#hot_count').html('99+'); }
      else { $('#hot_count').html(ret.countH); }
    } else { $('#hot_count').hide(); }
  });
});
</script>
#end